<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>文章管理</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="/Public/admin/i/favicon.png">
    <link rel="apple-touch-icon-precomposed"
          href="/Public/admin/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="/Public/admin/css/amazeui.min.css"/>
    <link rel="stylesheet"
          href="/Public/admin/css/amazeui.datatables.min.css"/>
    <link rel="stylesheet" href="/Public/admin/css/app.css">
    <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="/Public/admin/js/jquery.js"></script>
    <script src="/Public/admin/js/layer/layer.js"></script>
    <script src="/Public/admin/js/dialog.js"></script>

</head>
<style type="text/css">
    .color {
        color: #FFFFFF;
        text-decoration: none;
        font-weight: bold;
    }

    /*链接设置*/
    .color:visited {
        color: #FFFFFF;
        text-decoration: none;
        font-weight: bold;
    }

    /*访问过的链接设置*/
    .color:hover {
        color: #FFFFFF;
        text-decoration: none;
        font-weight: bold;
    }

    /*鼠标放上的链接设置*/
</style>
<body data-type="widgets">
<script src="/Public/admin/js/theme.js"></script>
<div class="am-g tpl-g">
    <!-- 头部 -->
    <include file="Index/top_menu"/>

    <!-- 风格切换 -->
    <div class="tpl-skiner">
        <div class="tpl-skiner-toggle am-icon-cog"></div>
        <div class="tpl-skiner-content">
            <div class="tpl-skiner-content-title">选择主题</div>
            <div class="tpl-skiner-content-bar"><span
                    class="skiner-color skiner-white" data-color="theme-white"></span> <span
                    class="skiner-color skiner-black" data-color="theme-black"></span></div>
        </div>
    </div>
    <!-- 侧边导航栏 -->
    <include file="Index/left_menu"/>

    <!-- 内容区域 -->
    <div class="tpl-content-wrapper">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title  am-cf">文章列表</div>


                        </div>
                        <div class="widget-body  am-fr">

                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                <div class="am-form-group">
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                            <script type="text/javascript">
                                                //                                                function release() {
                                                //                                                    location.href = "article_release.php?a_id=0";
                                                //                                                }
                                                function delete_php(a_id) {
                                                    result = confirm("是否确认删除！！！");
                                                    if (result == true) {
//                                                        alert(a_id);
//                                                        location.href = "/admin.php?c=article&a=delete&a_id=" + a_id;
                                                        var url = "/admin.php?c=article&a=delete";
                                                        var data = {'a_id': a_id};
                                                        //执行异步请求 $.post
                                                        $.post(url, data, function (result) {
                                                            if (result.status == 0) {
                                                                return dialog.error(result.message);
                                                            } else if (result.status == 1) {
                                                                return dialog.success(result.message, '/admin.php?c=article')
                                                            }
                                                        }, 'JSON');
                                                    }

                                                }
                                            </script>
                                            <button type="button" class="am-btn am-btn-default am-btn-success"
                                                    onclick="location.href='/admin.php?c=article&a=show';"><a
                                                    href="/admin.php?c=article&a=show" class="color"><span
                                                    class="am-icon-plus"></span>
                                                新增</a>
                                            </button>
                                            &nbsp;
                                            <button type="button" class="am-btn am-btn-default am-btn-primary"
                                                    onclick="location.href='/admin.php?c=article';"><a
                                                    href="/admin.php?c=article" class="color"><span
                                                    class="am-icon-list-ul"></span>
                                                全部</a>
                                            </button>
                                            &nbsp;
                                            <button type="button" class="am-btn am-btn-default am-btn-warning"
                                                    onclick="location.href='/admin.php?c=article&a=article&a=index&a_state=1';"><a
                                                    href="/admin.php?c=article&a=article&a=index&a_state=1"
                                                    class="color"><span
                                                    class="am-icon-check-square"></span>
                                                发布</a>
                                            </button>
                                            &nbsp;
                                            <button type="button" class="am-btn am-btn-default am-btn-secondary"
                                                    onclick="location.href='/admin.php?c=article&a=article&a=index&a_state=2';"><a
                                                    href="/admin.php?c=article&a=article&a=index&a_state=2"
                                                    class="color"><span
                                                    class="am-icon-gavel"></span>
                                                置顶</a>
                                            </button>
                                            &nbsp;
                                            <button type="button" class="am-btn am-btn-default am-btn-danger"
                                                    onclick="location.href='/admin.php?c=article&a=article&a=index&a_state=3';"><a
                                                    href="/admin.php?c=article&a=article&a=index&a_state=3"
                                                    class="color"><span
                                                    class="am-icon-trash-o"></span>
                                                回收站</a>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                                <div class="am-form-group tpl-table-list-select">
                                    <select
                                            data-am-selected="{btnSize: 'sm'}" onchange="self.location.href=options[selectedIndex].value">
                                        <option value="option1">所有类别</option>
                                        <volist name="type_list" id="type">
                                            <option value="/admin.php?c=article&a=index&a_type={$type}">{$type}
                                            </option>
                                        </volist>
                                    </select></div>
                            </div><form method="post" action="/admin.php?c=article&a=index">
                            <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">

                                    <input type="text" name="select" value="{$select}" class="am-form-field "> <span
                                        class="am-input-group-btn">
                                    <button
                                        class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search"
                                        type="submit">
                                    </button>

                            </span></div>
                            </div></form>

                            <div class="am-u-sm-12">
                                <table width="100%"
                                       class="am-table am-table-compact am-table-striped tpl-table-black ">
                                    <thead>
                                    <tr>
                                        <th>文章缩略图</th>
                                        <th>文章标题</th>
                                        <th>作者</th>
                                        <th>时间</th>
                                        <th>分类</th>
                                        <th>状态</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>


                                    <volist name="article_list" id="list">
                                        <tr class="gradeX">
                                            <td><img src="{$list.a_photo}" class="tpl-table-line-img"
                                                     alt=""></td>
                                            <td class="am-text-middle">{$list.a_title}</td>
                                            <td class="am-text-middle">{$list.a_adduser}</td>
                                            <td class="am-text-middle">{$list.a_addtime}</td>
                                            <td class="am-text-middle">{$list.a_type}</td>
                                            <if condition="$list.a_state == 1">
                                                <td class="am-text-middle">显示</td>
                                            </if>
                                            <if condition="$list.a_state == 0">
                                                <td class="am-text-middle">隐藏</td>
                                            </if>
                                            <if condition="$list.a_state == 2">
                                                <td class="am-text-middle">置顶</td>
                                            </if>
                                            <if condition="$list.a_state == 3">
                                                <td class="am-text-middle">删除</td>
                                            </if>
                                            <td class="am-text-middle">
                                                <div class="tpl-table-black-operation">
                                                    <!--<a target="_blank"-->
                                                       <!--href="/index.php?c=article&a=show&a_id={$list.a_id}&tip=1"> <i-->
                                                            <!--class="am-icon-eye"></i> 预览 </a>-->
                                                    <a href="/admin.php?c=article&a=stick&a_id={$list.a_id}"> <i
                                                            class="am-icon-gavel"></i>
                                                        <if condition="$list.a_state == 1">
                                                            置顶
                                                        </if>
                                                        <if condition="$list.a_state == 2">
                                                            显示
                                                        </if>
                                                        <if condition="$list.a_state == 3">
                                                            显示
                                                        </if>
                                                        <if condition="$list.a_state == 0">
                                                            显示
                                                        </if>

                                                    </a>
                                                    <a href="/admin.php?c=article&a=show&a_id={$list.a_id}&tip=2"> <i
                                                        class="am-icon-pencil"></i> 快速编辑 </a>
                                                    <a target="_blank" href="/admin.php?c=article&a=themes&a_id={$list.a_id}"> <i
                                                            class="am-icon-pencil"></i> 内容编辑 </a>
                                                    <a href="" onclick="delete_php('{$list.a_id}')"
                                                       class="tpl-table-black-operation-del"> <i
                                                            class="am-icon-trash"></i>
                                                        删除 </a>
                                                </div>
                                            </td>
                                        </tr>
                                    </volist>

                                    <!-- more data -->
                                    </tbody>
                                </table>
                            </div>
                            <div class="am-u-lg-12 am-cf">

                                <div class="am-fr">
                                    <ul class="am-pagination tpl-pagination">
                                        <volist name="page_list" id="page">
                                            <li class="{$page.class}"><a href="{$page.href}">{$page.num}</a></li>
                                        </volist>

                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<script src="http://cdn.bootcss.com/amazeui/2.7.2/js/amazeui.min.js"></script>
<script src="/Public/admin/js/app.js"></script>

</body>

</html>
